package wahadlo.gui;

import java.awt.Container;

import javax.swing.JComponent;
import javax.swing.SpringLayout;

public class MainFrame {

	private JComponent axisComponent;
	private JComponent dataComponent;
	private AuthorComponent authorComponent;
	private JComponent controllComponent;

	private final SpringLayout layout = new SpringLayout();
	private Container container;

	public void init(Container container) {
		if (container == null) {
			throw new NullPointerException("Container is NULL");
		}
		this.container = container;
		this.container.setLayout(layout);
		authorComponent = new AuthorComponent();
		this.container.add(authorComponent);
		
		doLayout();
	}

	private void doLayout() {
		layout.putConstraint(SpringLayout.SOUTH, authorComponent, -5, SpringLayout.SOUTH, this.container);
		layout.putConstraint(SpringLayout.WEST, authorComponent, 10, SpringLayout.WEST, this.container);
	}
}
